/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rainful.servlet;

import com.caucho.hessian.server.HessianServlet;
import rainful.DataAgent;
import rainful.DataAction;
import java.util.List;

/**
 *
 * @author Rovers
 */
public class DataCloud extends HessianServlet implements DataAction {

    public <T> T selectSingle(Class<T> c, Long id) {
        return DataAgent.getInstance().selectSingle(c, id);
    }

    public <T> List<T> select(Class<T> c) {
        return DataAgent.getInstance().select(c);
    }

    public <T> List<T> select(Class<T> c, String filter, String ordering) {
        return DataAgent.getInstance().select(c, filter, ordering);
    }

    public void persist(Object data) {
        DataAgent.getInstance().persist(data);
    }

    public <T> void persistAll(List<T> datalist) {
        DataAgent.getInstance().persistAll(datalist);
    }
}
